/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Owner
 */
public class VertexTest {
    
    //issues with adding Edges<Double> to make test pass
    
    private static model.Vertex<Double> vertexTest1;
    private model.Vertex<Double> vertexTest2;
    
    public VertexTest() {
    }
    
    @BeforeClass
    public static void setUpClass() {        
        vertexTest1 = new model.Vertex<>();        
    }
    
    @AfterClass
    public static void tearDownClass() {
        vertexTest1 = null;
    }
    
    @Before
    public void setUp() {
        vertexTest2 = new model.Vertex<>(6.0, "Test");
    }
    
    @After
    public void tearDown() {
        vertexTest2 = null;
    }

    /**
     * Test of getData method, of class Vertex.
     */
    @Test
    public void testGetData() {
        System.out.println("getData");
        Object expResult = 6.0;
        Object result = vertexTest2.getPointData();
        assertEquals(expResult, result);

    }

    /**
     * Test of getName method, of class Vertex.
     */
    @Test
    public void testGetName() {
        System.out.println("getName");
        String expResult = "Test";
        String result = vertexTest2.getName();
        assertEquals(expResult, result);
    }

    /**
     * Test of toString method, of class Vertex.
     */
    @Test
    public void testToString() {
        System.out.println("toString");
        String expResult = "Test";
        String result = vertexTest2.toString();
        assertEquals(expResult, result);
    }

    /**
     * Test of addEdge method, of class Vertex.
     */
    @Test
    public void testAddEdge() {
        System.out.println("addEdge");
        Edge<Double> tester = new Edge<Double>();
        tester.setWeight(3.3);
        vertexTest2.addEdge(tester);
        Object temp = vertexTest2.getEdges();
        Object expResult = 3.3;
        assertEquals(expResult, temp);
    }

    /**
     * Test of getEdges method, of class Vertex.
     */
    @Test
    public void testGetEdges() {
        System.out.println("getEdges");
        Edge<Double> test = new Edge<Double>();
        vertexTest2.addEdge(test);
        List<Edge> expResult = null;
        Object result = vertexTest2.getEdges();
        assertEquals(expResult, result);
    }

    /**
     * Test of equals method, of class Vertex.
     */
    @Test
    public void testEquals() {
        System.out.println("equals");
        Vertex v = null;
        Vertex vertexTest2 = null;
        boolean expResult = false;
        boolean result = vertexTest2.equals(vertexTest2);
        assertEquals(expResult, result);
    }
    
   @Test
   public void testSetName(){
       System.out.println("setName");
       String expResult = "testing";
       vertexTest2.setName("testing");
       assertEquals(expResult, "testing");
   }
    
}
